home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
pascal
/
tegl6b.zip
/
INTROPAK.EXE
/
lha
/
TEGLUNIT.DOC
< prev
next >
Wrap
Text File
|
1991-08-16
|
15KB
|
330 lines
{-----------------------------------------------------------------------------}
{ TEGL Windows ToolKit II }
{ Copyright (C) 1990, 1991 TEGL Systems Corporation }
{ All Rights Reserved. }
{-----------------------------------------------------------------------------}
{$I switches.inc}
Unit TEGLUnit;
INTERFACE
USES
Crt, {clear keyboard}
Errorlog,
VirtMem, {virtual Memory}
IPStacks,
TEGLIntr, {keyboard/mouse}
FastGrph;
const
MSSense = TRUE;
MSClick = FALSE;
Vertslice : boolean = false;
TYPE
{ The four pointers below provides the total integration of TEGL, of which the
ImageStkPtr is the main structure that ties everything together. The
hierarchy is such that the MsClickPtrs and KeyClickPtrs are pointer chained
within an Imagestkptr. }
TimeTickPtr = ^TimeTickStk;
KeyClickPtr = ^KeyClickStk;
MsClickPtr = ^MSClickStk;
ImageStkPtr = ^ImageStack;
{ Global Keyclickptr --> Keyclickptr --> Keyclickptr
| \
| \
| \
ImageStkPtr --> ImageStkPtr --> ImageStkPtr
| | | | | |
Local Keyclickptr | Keyclickptr | Keyclickptr |
msclickptr msclickptr msclickptr
/
/
/
TimeTickPtr --> TimeTickPtr --> TimeTickPtr
}
Callproc = Function(FS:ImageStkPtr; MS: MsClickPtr):Word;
Dataproc = Function(FS:ImageStkPtr; Userkey:word; Var DataArea):Word;
XYX1Y1Rec = RECORD
x,y,x1,y1 : Word; {coordinate structure for msclick}
END;
TimeTickStk = RECORD
nexttimetick : TimeTickptr; {chain of timer tick events}
timepiece : timerecptr; {timer counter, flag}
signature : longint; {signature for dropping timer ticks}
entrycallproc : callproc; {timer event - when flag is true}
fs : ImageStkPtr; {related fs/ms for event}
ms : MsClickPtr;
END;
KeyClickStk = RECORD
nextkeyclick : Keyclickptr; {chain of keyboard click areas}
keycode : Word; {scancode for capturing}
entrycallproc : callproc; {event for scancode activation}
fs : ImageStkPtr; {related fs/ms for event}
ms : MsClickPtr;
END;
MSClickStk = RECORD
nextmsclick : MsClickPtr; {mouse click chains}
ClickNumber : Word; {assignable key for mouse click}
ms : XYX1Y1Rec; {mouse x,y,x1,y1 region}
msactive : Boolean; {sets inactive mode of mouse}
entrycallproc : callproc; {normal mouse click call event}
senseactivate : Boolean; {true-sense,false-mouse click}
sensehighlight : Boolean; {enables supervisor to auto }
{highlight a mouse click area}
MouseButtons : word; {Defines the active mouse button}
{2-right mouse button}
DoubleCallproc : callproc; {double click event}
MouseMask : maskptr; {autochanging of mouse mask}
xHotSpot : word; {mouse hot spot of mouse mask}
yHotSpot : word;
IPPtr : imagepartial; {Mouse click image partials}
{used in sliders and pop-off buttons}
END;
FrameChangePtr = ^FrameChange;
FrameChange = Record
FrameEnter : callproc; {Frame Enter Event}
FrameExit : callproc; {Frame Exit Event}
EnterMask : maskptr; {Enter frame Mouse Mask}
XEHS,YEHS : word; {Enter frame Mouse Hotspots}
ExitMask : maskptr; {Exit frame Mouse Mask}
XXHS,YXHS : word; {Exit frame Mouse Hotspots}
end;
UserRecPtr = ^UserRecord;
UserRecord = Record
NxtUserPtr : UserRecPtr; {user data area chains}
UserKey : word; {user assigned key for retrieving data}
UserDataArea : pointer; {pointer to userdata}
UserTerminate : dataproc; {terminating call event}
end;
PendingPtr = ^PendRecord;
PendRecord = Record
NxtPendPtr : PendingPtr; {pending event chains}
PendCallproc : callproc; {pending call proc}
PendingFS : imagestkptr; {pending matching FS}
PendingClose : boolean; {ignore close pending if false}
end;
moveptr = ^moverecord;
moverecord = record
nxtmove : moveptr;
movecallproc : callproc; {a user definable event when frame is
{moved}
end;
ImageStack = RECORD
nxtptr : ImageStkPtr; {forward chain of Frames}
lstptr : ImageStkPtr; {backward chain for frame stack}
signature : longint; {time code signature}
FrameActive : Word; {set by resetframeactive for locking}
{events from occuring}
x,y,x1,y1 : Word; {frame coordinates}
movable : Boolean; {flag indicating mobility of frame}
movecallproc : moveptr; {move event chain}
iconframe : pointer; {icon for putpict when moving frame}
iconcolor : word; {icon color}
emptyframe : boolean; {flag indicating empty frame}
autorotate : boolean; {indicator if frame can be rotated up}
RestrictMoveF : XYX1Y1Rec; {move area restriction}
MinMaxStretch : XYX1Y1Rec; {minimum/maximum resize}
Resizecallproc : callproc; {required event for re-drawing frame}
{after frame has been re-sized}
ImageActive : Boolean; {frame hiding/showing flag}
relatedstack : ImageStkPtr; {related fs for use in Menus and explodes}
relatedmsclick : MsClickPtr; {related ms for use in Menus and explodes}
relatedsignate : longint; {related signate for use in pending}
chainedstack : ImageStkPtr; {chained fs sub menu}
chainedmsclick : MsClickPtr; {chained ms sub menu}
IPPtr : imagepartial; {image partial chain}
IPTop : imagepartial; {image partial top of chain}
keyPtr : KeyClickPtr; {key chain for local keyclicks}
MsPtr : MsClickPtr; {ms chain for mouse click areas}
MsClickCount : Word; {ms clicks counts}
fschangePtr : Framechangeptr;{frame enter/exit events}
UserDataPtr : UserRecPtr; {user data chain}
END;
const
{*------------------------------------------------------------------------*
| Window Stack |
*------------------------------------------------------------------------*}
StackPtr : ImageStkPtr = NIL; {Central Image Stack}
KeyStackPtr : KeyClickPtr = NIL; {Global Key Stack}
TimeStackPtr : TimeTickPtr = NIL; {Global Time Stack Ptr}
PendStackPtr : PendingPtr = NIL; {Global Pending Stack Ptr}
FunctionKeyCode : Word = 0; {last TEGLKeypress}
AutoRotateUp : Boolean = FALSE; {set on for autorotate}
LastFSDetect : ImageStkPtr = NIL; {last detect fs/ms values}
LastMSDetect : MsClickPtr = NIL; {used in cursor mask changes}
StandardMask : Maskptr = nil; {and mouse click highlighting}
Standardxhs : word = 0;
Standardyhs : word = 0;
CurrentMask : Maskptr = nil;
Currentxhs : word = 0;
Currentyhs : word = 0;
MaxWindowSize : longint = $00020000; {Maximum size for frame partial}
{ $7fffffff - no size limit}
{ $00008000 - 32k limit}
{ $00004000 - 16k limit}
VAR
CtrlBreakProc : CallProc;
{*------------------------------------------------------------------------*
| Image Stack routines |
*------------------------------------------------------------------------*}
Function FrameExist(fs:ImageStkPtr) : Boolean;
Function CountFrames : Word;
Procedure PushImage(x,y,x1,y1 : Word);
Procedure PushEmptyImage(x,y,x1,y1 : Word);
Procedure PopImage;
Procedure PrepareForPartialUpdate(FS:ImageStkPtr; x,y,x1,y1: Word);
Procedure PrepareForUpdate(FS:ImageStkPtr);
Procedure CommitUpdate;
Procedure SetFrameAutoRotate(fs:imagestkptr; Autorotate:boolean);
Procedure RotateStackImage(FS1,FS2 :ImageStkPtr);
Procedure RotateUnderStackImage(FS1,FS2 :ImageStkPtr);
Procedure MoveFrame(VAR fx,fy,fx1,fy1 : Integer; rx,ry,rx1,ry1: Integer; Color : Integer);
Function FrameSelectAndMove(mxpos,mypos : Word) : ImageStkPtr;
Function SelectandMoveFrame(fs:ImageStkPtr; MouseClickPos: MsClickPtr) : Word;
Procedure SetMoveRestrictions(fs:ImageStkPtr; x,y,x1,y1:Word);
Procedure SetFrameMobility(fs:ImageStkPtr; movable : Boolean);
Procedure DropMoveFrameCallProc(fs:ImageStkPtr; En